//
//  SelfVitalityVC.m
//  DefendHealth
//
//  Created by UNOHACHA on 17/2/21.
//  Copyright © 2017年 iMacOne. All rights reserved.
//

#import "SelfVitalityVC.h"

#import "VitalityCell.h"

@interface SelfVitalityVC ()

@end

@implementation SelfVitalityVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self.leftbutton setImage:IMAGE(@"return@2x1") forState:UIControlStateNormal];
//    self.leftbutton.hidden = YES;
    [self.rigltbutton setImage:nil forState:UIControlStateNormal];
    
    self.TitleNav.text = @"我的活力值";
    self.TitleNav.textColor = kWhiteColor;
    [self.view addSubview:self.TitleNav];
    
    [self.rigltbutton setTitle:@"活力商城" forState:UIControlStateNormal];
    [self.rigltbutton setTitleColor:kWhiteColor forState:UIControlStateNormal];
    self.rigltbutton.x = kScreenWidth-80;

    UIButton * leftbutton = [UIButton buttonWithType:UIButtonTypeCustom];
    leftbutton.frame = CGRectMake(0, 20, 60, 44);
    
    //     UIImage *imgFullNet = [UIImage imageNamed:@"CodeScan.bundle/qrcode_scan_full_net"];
    
    [leftbutton setImage:[UIImage imageNamed:@"CodeScan.bundle/qrcode_scan_titlebar_back_nor@2x"] forState:UIControlStateNormal];
    
    [leftbutton addTarget:self action:@selector(leftEvents) forControlEvents:UIControlEventTouchUpInside];
    
//    [self.Nav addSubview:leftbutton];
    
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 2;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
 
   return  [self sharedFirstView];
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 172.f;
}


- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    return  nil ;
}


- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.f;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 60;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    NSString * cellIdentif = @"VitalityCell";
    VitalityCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIdentif];
    if (!cell) {
        
        cell = [[VitalityCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentif];
    }
    
    return cell;
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}





- (UIView *)sharedFirstView {
    
    UIImageView * bigImg = [ReduceCode creatImageVeiwWithFrame:CGRectMake(0, 0, kScreenWidth, 172) imageName:@"" isCorner:NO];
    bigImg.backgroundColor = UIColorFromRGB(0xcccaca);
    
    
    UILabel * titL = [ReduceCode creatLabelWithFrame:CGRectMake(0, 0, kScreenWidth, 40) title:@"1210" titleColor:kWhiteColor font:40 textAlignment:NSTextAlignmentCenter];
    titL.centerY = bigImg.centerY;
    [bigImg addSubview:titL];
    
    UILabel * dayL = [ReduceCode creatLabelWithFrame:CGRectMake(0, kMaxY(titL.frame)+12, kScreenWidth, 20) title:@"活力值" titleColor:kWhiteColor font:14 textAlignment:NSTextAlignmentCenter];
    [bigImg addSubview:dayL];
    
    return bigImg;
}






/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
